﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Add.ascx.vb" Inherits="WebForm_ImportVolunteer_Add" %>
<asp:ScriptManagerProxy ID="Proxy1" runat="server">
</asp:ScriptManagerProxy>
<asp:FormView ID="fv" runat="server">
    <ItemTemplate>
        <table width="100%" align="center">
            <tr>
                <td align="right">
                    <asp:Label ID="lblAvailableWorkPeriod" runat="server" meta:resourcekey="lblAvailableWorkPeriod"></asp:Label>
                </td>
                <td align="left" colspan="2">
                    <My:MyGridView ID="gvAvailableWorkPeriod" SkinID="pager" runat="server" AllowHoverEffect="false"
                        AllowHoverSelect="false">
                        <Columns>
                            <asp:BoundField DataField="AvailableWorkTime" meta:resourcekey="bfAvailableWorkTime" />
                            <asp:TemplateField meta:resourcekey="bfSundayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkSunday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideSunday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfMondayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkMonday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideMonday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfTuesdayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkTuesday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideTuesday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfWednesdayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkWednesday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideWednesday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfThursdayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkThursday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideThursday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfFridayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkFriday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideFriday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="bfSaturdayWorkTime">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkSaturday" runat="server"></asp:CheckBox>
                                    <asp:HiddenField ID="hideSaturday" runat="server" />
                                </itemtemplate>
                            </asp:TemplateField>
                        </Columns>
                    </My:MyGridView>
                </td>
            </tr>
            <tr>
                 <asp:UpdatePanel ID="upOrganizationID" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <td align="right">
                            <asp:Label ID="lblOrganizationID" runat="server" meta:resourcekey="lblOrganizationID"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlOrganizationID" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlOrganizationID_SelectedIndexChanged">
                            </asp:DropDownList>
                           <asp:RequiredFieldValidator ID="rfvddlOrganizationID" runat="server" meta:resourcekey="rfvddlOrganizationID" ControlToValidate="ddlOrganizationID"   Display="None"  SetFocusOnError="true" ValidationGroup="vUpload"></asp:RequiredFieldValidator>

                        </td>
                        <asp:PlaceHolder ID="phVOrganizationID" runat="server" Visible="false">
                            <td align="right">
                                <asp:Label ID="lblVOrganizationID" runat="server" meta:resourcekey="lblVOrganizationID"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlVOrganizationID" runat="server" AutoPostBack="false">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvVOrganizationID" runat="server" meta:resourcekey="rfvVOrganizationID" ControlToValidate="ddlVOrganizationID"   Display="None"  SetFocusOnError="true" ValidationGroup="vUpload"></asp:RequiredFieldValidator>
                            </td>
                        </asp:PlaceHolder>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblUploadPath" runat="server" meta:resourcekey="lblUploadPath"></asp:Label>
                </td>
                <td align="left">
                    <asp:UpdatePanel ID="up" runat="server" UpdateMode="conditional">
                        <ContentTemplate>
                            <asp:FileUpload ID="FileUpload1" runat="server" />
                            <%--                        </td>
                        <td align="left">--%>
                            <asp:Button ID="btnUpload" runat="server" meta:resourcekey="btnUpload" CommandName="btnUpload" ValidationGroup="vUpload" />
                            <ajaxToolkit:ConfirmButtonExtender ID="cbUpload" runat="server" TargetControlID="btnUpload"
                                meta:resourcekey="cbUpload">
                            </ajaxToolkit:ConfirmButtonExtender>
                             <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vUpload" />
                        </ContentTemplate>
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnUpload" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
                <td>
                    <%--<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Public/ImportVolunteerSample.xls">範例檔</asp:HyperLink>--%>
                    <a href="<%= Me.ResolveUrl(MyObj.GetFilePath("ImportVolunteerSample", True)) %>">範例檔</a>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:FormView>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
    <RowStyle Font-Size="X-Small" />
    <Columns>
        <%--<asp:BoundField DataField="身份證號" HeaderText="身份證號" />--%>
        <asp:TemplateField HeaderText="身份證號">
            <ItemTemplate>
                <asp:Label ID="txtVolunteerID" runat="server" Text='<%# Bind("身份證號") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>        
        <asp:BoundField DataField="姓名" HeaderText="姓名" />
        <asp:TemplateField HeaderText="生日">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("生日") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <%--<asp:Label ID="Label1" runat="server" Text='<%# "民國"+(Year(Eval("生日"))-1911).tostring+Eval("生日", "{0:年MM月dd日}") %>'></asp:Label>--%>
                <asp:Label ID="Label1" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="行動電話" HeaderText="行動電話" />
        <asp:BoundField DataField="聯絡電話" HeaderText="聯絡電話" />
        <asp:BoundField DataField="區與里" HeaderText="區與里" />
        <asp:BoundField DataField="通訊住址" HeaderText="通訊住址" />
        <asp:BoundField DataField="民間團體" HeaderText="民間團體" />
        <asp:BoundField DataField="檢查結果" HeaderText="檢查結果" />
        <asp:TemplateField>
            <ItemTemplate>
                <asp:MultiView ID="mvDelete" runat="server" ActiveViewIndex="0">
                    <asp:View ID="vwDelete" runat="server">
                        <asp:LinkButton ID="lknDelete" runat="server" meta:resourcekey="lknDelete" CommandName="Delete"></asp:LinkButton>
                    </asp:View>
                    <asp:View ID="vwDeleted" runat="server">
                        <asp:Label ID="txtDeleted" runat="server" meta:resourcekey="txtDeleted"></asp:Label>
                    </asp:View>                    
                </asp:MultiView>
                
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <HeaderStyle BackColor="CornflowerBlue" Font-Bold="True" ForeColor="White" />
</asp:GridView>
